package com.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.demo.entity.Useradmin;
import com.demo.mapper.UseradminMapper;
import com.demo.service.UseradminService;

import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;
@Service
public class UseradminServiceImpl implements UseradminService{
	@Autowired
	UseradminMapper um;

	@Override
	public Useradmin findOne(Integer id) {
		// TODO Auto-generated method stub
		return um.selectByPrimaryKey(id);
	}

	@Override
	public Useradmin findUseradminByNameAndPassword(Useradmin useradmin) {
		// TODO Auto-generated method stub
		Example example = new Example(Useradmin.class); 
		Criteria criteria = example.createCriteria();
		criteria.andEqualTo("id", 1);
		List<Useradmin> us=um.selectByExample(example);
		return um.selectOne(useradmin);
	}

}
